.class public abstract Lcom/sponsorpay/sdk/android/publisher/AbstractConnector;
.super Ljava/lang/Object;
.source "AbstractConnector.java"

# interfaces
.implements Lcom/sponsorpay/sdk/android/publisher/AsyncRequest$AsyncRequestResultListener;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "<V:",
        "Ljava/lang/Object;",
        ">",
        "Ljava/lang/Object;",
        "Lcom/sponsorpay/sdk/android/publisher/AsyncRequest$AsyncRequestResultListener;"
    }
.end annotation


# static fields
.field protected static final URL_PARAM_KEY_TIMESTAMP:Ljava/lang/String; = "timestamp"


# instance fields
.field protected mContext:Landroid/content/Context;

.field protected mCredentials:Lcom/sponsorpay/sdk/android/credentials/SPCredentials;

.field protected mCustomParameters:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field protected mUserListener:Ljava/lang/Object;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "TV;"
        }
    .end annotation
.end field

.field protected remoteResourceUrl:Ljava/lang/String;


# direct methods
.method protected constructor <init>(Landroid/content/Context;Ljava/lang/String;Ljava/lang/Object;)V
    .locals 2
    .parameter "context"
    .parameter "credentialsToken"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/lang/String;",
            "TV;)V"
        }
    .end annotation

    .prologue
    .line 49
    .local p0, this:Lcom/sponsorpay/sdk/android/publisher/AbstractConnector;,"Lcom/sponsorpay/sdk/android/publisher/AbstractConnector<TV;>;"
    .local p3, userListener:Ljava/lang/Object;,"TV;"
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 50
    iput-object p1, p0, Lcom/sponsorpay/sdk/android/publisher/AbstractConnector;->mContext:Landroid/content/Context;

    .line 51
    invoke-static {p2}, Lcom/sponsorpay/sdk/android/SponsorPay;->getCredentials(Ljava/lang/String;)Lcom/sponsorpay/sdk/android/credentials/SPCredentials;

    move-result-object v0

    iput-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/AbstractConnector;->mCredentials:Lcom/sponsorpay/sdk/android/credentials/SPCredentials;

    .line 52
    iput-object p3, p0, Lcom/sponsorpay/sdk/android/publisher/AbstractConnector;->mUserListener:Ljava/lang/Object;

    .line 53
    iget-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/AbstractConnector;->mCredentials:Lcom/sponsorpay/sdk/android/credentials/SPCredentials;

    invoke-virtual {v0}, Lcom/sponsorpay/sdk/android/credentials/SPCredentials;->getSecurityToken()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/sponsorpay/sdk/android/utils/StringUtils;->nullOrEmpty(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 54
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "Security token has not been set on the credentials"

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 56
    :cond_0
    return-void
.end method


# virtual methods
.method protected getCurrentUnixTimestampAsString()Ljava/lang/String;
    .locals 5

    .prologue
    .line 71
    .local p0, this:Lcom/sponsorpay/sdk/android/publisher/AbstractConnector;,"Lcom/sponsorpay/sdk/android/publisher/AbstractConnector<TV;>;"
    const/16 v0, 0x3e8

    .line 72
    .local v0, MILLISECONDS_IN_SECOND:I
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v1

    const-wide/16 v3, 0x3e8

    div-long/2addr v1, v3

    invoke-static {v1, v2}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object v1

    return-object v1
.end method

.method public setCustomParameters(Ljava/util/Map;)V
    .locals 0
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 62
    .local p0, this:Lcom/sponsorpay/sdk/android/publisher/AbstractConnector;,"Lcom/sponsorpay/sdk/android/publisher/AbstractConnector<TV;>;"
    .local p1, customParams:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>;"
    iput-object p1, p0, Lcom/sponsorpay/sdk/android/publisher/AbstractConnector;->mCustomParameters:Ljava/util/Map;

    .line 63
    return-void
.end method
